#include "tools.cpp"

class Solution {
  public:
    vector<vector<int>> generate(int numRows) {
        std::vector<vector<int>> result;
        if (numRows == 0) return result;
        result.push_back(std::vector<int>{1});
        for (int i = 1; i < numRows; ++i) {
            std::vector<int> tmp{1};
            for (int j = 0; j < result[i - 1].size() - 1; ++j) {
                tmp.push_back(result[i - 1][j] + result[i - 1][j + 1]);
            }
            tmp.push_back(1);
            result.push_back(std::move(tmp));
        }
        return result;
    }
};

int main() {
    Solution s;
    s.generate(5);
}
